<?php

/**
 * ContactForm class.
 * ContactForm is the data structure for keeping
 * contact form data. It is used by the 'contact' action of 'SiteController'.
 */
class ContactForm extends CFormModel {

    public $name;
    public $ddd;
    public $telefone;
    public $cidade;
    public $email;
    public $body;

    /**
     * Declares the validation rules.
     */
    public function rules() {
        return array(
            // name, email, subject and body are required
            array('name, ddd, telefone,cidade, email, body', 'required', 'message' => '{attribute} é obrigatório.'),
            // email has to be a valid email address
            array('email', 'email','message'=>'{attribute} inválido.'),
            array('name','length','min'=>'10','tooShort' => '{attribute} deve ter pelo menos 10 caracteres.')            
        );
    }

    /**
     * Declares customized attribute labels.
     * If not declared here, an attribute would have a label that is
     * the same as its name with the first letter in upper case.
     */
    public function attributeLabels() {
        return array(
            'verifyCode' => 'Verification Code',
            'name' => 'Nome',
            'ddd' => 'DDD',
            'telefone' => 'Telefone',
            'cidade' => 'Cidade',
            'email' => 'Email',
            'body' => 'Assunto',
        );
    }

}